PreviousNextTracker indexSee it online !

(54/185) 131 - JDiffPlugin : insert virtual empty lines

Hi, in dual diff, when there is a skew between identical lines of the two files (new lines or text inserted in one of them for example), it would be great if it was possible to insert virtual blank lines in the file that miss them so identical lines would always be aligned

Submitted kpouer - 2009-04-24 08:47:39 Assigned daleanson
Priority 5 Labels
Status open Group None
Resolution None

Comments

2009-04-24 13:41:19
daleanson

Do you have an idea of how this might be done? I don't see any jEdit API for inserting virtual blank lines, so I think I'd have to insert actual blank lines and figure out some way to track which lines were inserted so they could be removed later. Do you know of a better approach to this?

2009-04-24 13:57:32
kpouer

in fact I have no good idea yet except really adding those empty lines (maybe it would be better than nothing if it is not automatic)

2009-09-09 05:58:01
*anonymous

I have two ideas how to implement this:
1. Maintain in the plugin the list of blank lines inserted, so they can be removed later. Optionally the plugin can replace the original buffers with temporary ones, and when done update the original buffers.
2. jEdit supports virtual lines for the soft-wrap feature. Maybe this can be used? I am not familiar with the technical details,

2009-12-07 11:20:19
*anonymous

I checked this some time ago, and idea (2) is really not feasible with the current implementation of soft-wrap. To allow blank virtual lines, the core needs to be modified.
I guess the only way to go is what you suggested in the first place - manage the virtual blank lines in the plugin. This makes DirtyGutter plugin much closer in functionality to JDiffPlugin, as it also keeps track of inserted / removed lines.